import { createRouter, createWebHistory } from "vue-router";
import routes from "./routes";

const router = createRouter({
	history: createWebHistory(import.meta.env.BASE_URL),
	routes,
	scrollBehavior(_to, _from, savedPosition) {
		return savedPosition ? savedPosition : { top: 0 };
	},
});
router.beforeEach((_to, _from, next) => {
	next();
});
router.afterEach((_to, _from) => {});

export default router;
